#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)

#include <stdio.h>

int main()
{
	int n = 0;
	int k = 0;

	int sum1 = 0;
	int count1 = 0;
	float average1 = 0.0f;

	int sum2 = 0;
	int count2 = 0;
	float average2 = 0.0f;

	int i = 0;

	scanf("%d %d", &n, &k);

	for (i = 1; i <= n; i++)
	{
		if (i % k == 0)
		{
			sum1 += i;
			count1++;
		}
		else
		{
			sum2 += i;
			count2++;
		}
	}

	average1 = (float)sum1 / count1;
	average2 = (float)sum2 / count2;

	printf("%.1f %.1f", average1, average2);

	return 0;
}